home *** CD-ROM | disk | FTP | other *** search
/ The Ultimate Guide to Advanture Travel / The Ultimate Guide to Advanture Travel.iso / pc / installa.6 / Online Files / Tymnet < prev    next >
Text File  |  1995-07-10  |  16KB  |  549 lines

  1. !*****************************************************************************
  2. !   C O P Y R I G H T   A N D   C O N F I D E N T I A L I T Y   N O T I C E
  3. !*****************************************************************************
  4. !
  5. !      Copyright © 1987-1994 America Online, Inc.  All rights reserved.
  6. !      This software contains valuable confidential and proprietary
  7. !      information of America Online, Inc. and is subject to applicable
  8. !      licensing agreements.  Unauthorized reproduction, transmission or
  9. !      distribution of this file and its contents is a violation of
  10. !      applicable laws.
  11. !
  12. !            A M E R I C A   O N L I N E   C O N F I D E N T I A L
  13. !
  14. !*****************************************************************************
  15.  
  16. ! --------------------------------------------- 
  17. !   Tymnet CCL
  18. !   By: David Steinberg for America Online v2.1 and above
  19. !
  20. !   Version 2.1
  21. !
  22. !   Changed 3/19/90 by JRL to tolerate terse or no-response modes.
  23. !   Changed 3/19/90 by JRL to improve error responses.
  24. !   Mod     4/1/90 9:22am JRL
  25. !   Changed 7/3/90 by DMC to use ZMIT for modem string
  26. !   Changed 3/5/91 by DMC to use setup, teardown strings, 
  27. !      Prefix and disable call waiting strings, plus fix cmd period problem
  28. !   Changed 8/29/91 by DMC to report "Call cleared" as "all lines busy"
  29. !  Changed 2/23/93 by LMD to new matchstr format.
  30. !  Adding support for modem personality module CCL variables. - RG, 10/06/93
  31. !  Adding pauses before and after "+++" command. - RG, 1/21/94
  32. !  Adding new and improved connection messages. - RG, 2/23/94
  33. !----------------------------------------------------------
  34. !
  35. ! Connect Sequence:
  36. !
  37. -LABEL 0
  38. CanBtn "25"               { if cancel button - just exit }
  39. Jsr "CheckPhoneLength"
  40. NewLngInt bSerSpeed
  41. SetVar bSerSpeed ~BAUD
  42. CheckPort "25" ~PORT
  43. DsplyMsg "Step 1:  Initializing modem"
  44. SetTries 0
  45. ChrDelay 2
  46. SerReset ~BAUD 0 8 1
  47.  
  48. IfEq Handshake 0
  49.     Jump "TurnHandshakeOff"
  50.     
  51. -Label TurnHandshakeOn    
  52. IfEq HH_ON ""
  53.     Jump "TurnHandshakeOff"
  54.  
  55. HSReset 0 1 17 19
  56. Jump "WakeUpModem"
  57.     
  58. -Label TurnHandshakeOff    
  59. HSReset 0 0 17 19
  60.  
  61. -Label WakeUpModem
  62. DsplyPic 1
  63. !
  64. !-------------------------------------------------------
  65. !
  66. !
  67. -LABEL 1                { wake up the modem }
  68. Flush
  69. !-----------------------------------                        
  70. ZMIT "2" "$INIT$\0D"         { Send modem string; jump to 4 if empty}
  71. Pause 40            { Allow modem to settle between commands.}
  72. !
  73. -Label 2
  74. !
  75. ! *No longer allow +++ echoed as proof of initialization.*
  76. IfTries 0 3             { Only do this if we need to }
  77. ClrMchStr
  78. MatchStr "3" "OK"         
  79. MatchStr "3" ">"          { Special case for Avatex 1200 modems}
  80. MatchStr "3" "0\0D"       { Verbose is grandiose but terse ain't worse }
  81. !
  82. Pause 180               { Pause for 3 sec min gap }
  83. Xmit "+++"              { Get the modems attention}
  84. Pause 180               { Pause for 3 sec min gap }
  85. Xmit "$ATTENTION$H\0D"            {Hang up, just in case we were online}
  86. Wait 60                { Pause for 2 seconds, minimum gap required}
  87. !
  88. -Label 3 
  89. !-----------------------------------
  90. -LABEL 4                { just saw 'OK'- Set up modem }
  91. Flush
  92. !
  93. ClrMchStr
  94. MatchStr "5" "OK"         { We'd better be getting responses by now. }
  95. MatchStr "38" "ERROR"     { If not, something is wrong - we're gone. }
  96. MatchStr "5" ">"          {Special case for Avatex 1200}
  97. !
  98. Pause 40            { Allow modem to settle between commands.}
  99. IfEq Handshake 0
  100.   ZMIT "5" "$ATTENTION$$HH_OFF$$CONFIG$\0D"  { Send modem string; jump if empty}
  101. Else
  102.   ZMIT "5" "$ATTENTION$$HH_ON$$CONFIG$\0D"  { Send modem string; jump if empty}
  103. Wait 120                { Two seconds to get it right. }
  104. IncTries
  105. IfTries 1 1             { Try 1: Reset modem.  Try 2: Hang up/reset }
  106. Jump "33"
  107. !-----------------------------------
  108. -LABEL 5                { Now try to dial }
  109. DsplyMsg "Step 2:  Dialing ~PREF~NOCW~FONE"
  110. !
  111. ClrMchStr
  112. MatchStr "Got57600" "CONNECT 57600"
  113. MatchStr "Got38400" "CONNECT 38400"
  114. MatchStr "Got28800" "CONNECT 28800"
  115. MatchStr "Got26400" "CONNECT 26400"
  116. MatchStr "Got24000" "CONNECT 24000"
  117. MatchStr "Got21600" "CONNECT 21600"
  118. MatchStr "Got19200" "CONNECT 19200"
  119. MatchStr "Got16800" "CONNECT 16800"
  120. MatchStr "Got14400" "CONNECT 14400"
  121. MatchStr "Got12000" "CONNECT 12000"
  122. MatchStr "Got9600" "CONNECT 9600"
  123. MatchStr "Got4800" "CONNECT 4800"    
  124. MatchStr "Got2400" "CONNECT 2400\0D"    
  125. MatchStr "Got2400" "CONNECT 2400 "    
  126. MatchStr "Got2400" "CONNECT 2400/"    
  127. MatchStr "Got1200" "CONNECT 1200\0D"
  128. MatchStr "Got1200" "CONNECT 1200 "
  129. MatchStr "Got1200" "CONNECT 1200/"
  130. MatchStr "Got300" "CONNECT 300"
  131. MatchStr "Got300" "CONNECT\0D"     {assume "CONNECT" means the current baud rate}
  132. MatchStr "40" "NO DIAL"          
  133. MatchStr "27" "NO ANSWER"      
  134. MatchStr "41" "VOICE"           
  135. MatchStr "42" "NO CARRIER"     
  136. MatchStr "26" "BUSY"
  137. MatchStr "38" "ERROR"
  138. !
  139. SetTries 0
  140. CanBtn "24"               { if cancel button hit, hangUp then exit }
  141. Pause 30
  142. Xmit "$ATTENTION$D~TONE~PREF~NOCW~FONE\0D"
  143. !                       { jump to label #13 if match }
  144. Wait 3600               { wait 40 seconds for CONNECT msg from modem }
  145. !
  146. !
  147. ! This CCL section formerly checked for "300" through "9600" for
  148. ! no apparent reason - we do not support MNP connections and we'd
  149. ! never see that response string at this point anyway.
  150. !
  151. Jump "43"                { else hang up phone & exit  }
  152. !
  153. !-----------------------------------
  154. !
  155. -Label Got300
  156. DsplyMsg "Step 3:  Connecting at 300 bps"
  157. SetSpeed 300
  158. IfEq Handshake 0
  159.  SetVar bSerSpeed 300
  160. Jump "11"
  161. !
  162. -Label Got1200
  163. DsplyMsg "Step 3:  Connecting at 1200 bps"
  164. SetSpeed 1200
  165. IfEq Handshake 0
  166.  SetVar bSerSpeed 1200
  167. Jump "11"
  168. !
  169. -Label Got2400
  170. DsplyMsg "Step 3:  Connecting at 2400 bps"
  171. SetSpeed 2400
  172. IfEq Handshake 0
  173.  SetVar bSerSpeed 2400
  174. Jump "11"
  175. !
  176. -Label Got4800
  177. DsplyMsg "Step 3:  Connecting at 4800 bps"
  178. SetSpeed 4800
  179. IfEq Handshake 0
  180.  SetVar bSerSpeed 4800
  181. Jump "11"
  182. !
  183. -Label Got9600
  184. DsplyMsg "Step 3:  Connecting at 9600 bps"
  185. SetSpeed 9600
  186. IfEq Handshake 0
  187.  SetVar bSerSpeed 9600
  188. Jump "11"
  189. !
  190. -Label Got12000
  191. DsplyMsg "Step 3:  Connecting at 12000 bps"
  192. SetSpeed 12000
  193. IfEq Handshake 0
  194.  SetVar bSerSpeed 12000
  195. Jump "11"
  196. !
  197. -Label Got14400
  198. DsplyMsg "Step 3:  Connecting at 14400 bps"
  199. SetSpeed 14400
  200. IfEq Handshake 0
  201.  SetVar bSerSpeed 14400
  202. Jump "11"
  203. !
  204. -Label Got16800
  205. DsplyMsg "Step 3:  Connecting at 16800 bps"
  206. SetSpeed 16800
  207. IfEq Handshake 0
  208.  SetVar bSerSpeed 16800
  209. Jump "11"
  210. !
  211. -Label Got19200
  212. DsplyMsg "Step 3:  Connecting at 19200 bps"
  213. SetSpeed 19200
  214. IfEq Handshake 0
  215.  SetVar bSerSpeed 19200
  216. Jump "11"
  217. !
  218. -Label Got21600
  219. DsplyMsg "Step 3:  Connecting at 21600 bps"
  220. SetSpeed 21600
  221. IfEq Handshake 0
  222.  SetVar bSerSpeed 21600
  223. Jump "11"
  224. !
  225. -Label Got24000
  226. DsplyMsg "Step 3:  Connecting at 24000 bps"
  227. SetSpeed 24000
  228. IfEq Handshake 0
  229.  SetVar bSerSpeed 24000
  230. Jump "11"
  231. !
  232. -Label Got26400
  233. DsplyMsg "Step 3:  Connecting at 26400 bps"
  234. SetSpeed 26400
  235. IfEq Handshake 0
  236.  SetVar bSerSpeed 26400
  237. Jump "11"
  238. !
  239. -Label Got28800
  240. DsplyMsg "Step 3:  Connecting at 28800 bps"
  241. SetSpeed 28800
  242. IfEq Handshake 0
  243.  SetVar bSerSpeed 28800
  244. Jump "11"
  245. !
  246. -Label Got38400
  247. DsplyMsg "Step 3:  Connecting at 38400 bps"
  248. SetSpeed 38400
  249. IfEq Handshake 0
  250.  SetVar bSerSpeed 38400
  251. Jump "11"
  252. !
  253. -Label Got57600
  254. DsplyMsg "Step 3:  Connecting at 57600 bps"
  255. SetSpeed 57600
  256. IfEq Handshake 0
  257.  SetVar bSerSpeed 57600
  258. Jump "11"
  259. !
  260. !----------------------------------------------------------------------
  261. !
  262. -LABEL 11               { Modem just sent 'CONNECT' message }
  263. ifEq Handshake 1
  264.  Jump "AfterReset"
  265.  
  266. Pause 180
  267. Xmit "+++"                                                            { Go to command state }
  268. Pause 180
  269. SerReset bSerSpeed 0 8 1
  270. Wait 60
  271. MatchStr "AfterReset" "CONNECT"
  272. MatchStr "44" "NO CARRIER"     
  273. Xmit "$ATTENTION$O\0D"            { Go back to online state }
  274. Wait 60
  275.  
  276. -Label AfterReset
  277. DsplyPic 2
  278. Pause 600               {Give 10 seconds for line to settle on host side - NECESSARY on Tymnet}
  279. !
  280. -Label 12
  281. SetTries 0              
  282. !
  283. -LABEL 13
  284. !                         { Establishing Connection }
  285. ClrMchStr
  286. MatchStr "14" "LOG IN:"
  287. MatchStr "12" "IDENTIFIER"  {Still looking for 'A' but we're A-Okay.}
  288. MatchStr "32" "ABORTED"
  289. MatchStr "32" "HOST NOT"
  290. MatchStr "16" "ERROR"       { Maybe connected thru Alaska-net, do it the old way.}
  291. MatchStr "32" "BAD"
  292. MatchStr "32" "NOT PERMIT"
  293. MatchStr "44" "NO CARRIER"     
  294. !
  295. Flush
  296. DsplyMsg "Step 4:  Requesting network attention"
  297. Xmit "A"
  298. Wait 900
  299. IncTries
  300. IfTries 4 32
  301. Jump "13"
  302. !
  303. -Label 14
  304. ClrMchStr
  305. MatchStr "15" "+"
  306. MatchStr "34" "PASSWORD:"    {Didnt accept our Login;Password string.}
  307. MatchStr "16" "ERROR"
  308. MatchStr "32" "HOST SHUT"
  309. MatchStr "44" "NO CARRIER"     
  310. MatchStr "14" "LOG IN:"
  311. DsplyMsg "Step 5:  Talking to network"
  312. IfEq ~TYM2 ""
  313.      Xmit "~TYM1\0D"
  314. Else
  315.      Xmit "~TYM1;~TYM2\0D"        
  316. Wait 3600
  317. Jump "37"
  318. !
  319. -Label 15
  320. ClrMchStr
  321. MatchStr "23" "CALL CONNECTED"
  322. MatchStr "32" "CALL CLEARED"
  323. MatchStr "32" "HOST SHUT"
  324. MatchStr "44" "NO CARRIER"     
  325. DsplyMsg "Step 6:  Connecting to America Online"
  326. Xmit "~TYM3~TYM4\0D"
  327. Wait 3600
  328. Jump "37"
  329. !
  330. !
  331. !
  332. -Label 16                  {Try tymnets old way of connecting.}
  333. SetTries 0              
  334. !
  335. -Label 17
  336. ClrMchStr
  337. MatchStr "18" "PASSWORD:"
  338. MatchStr "32" "ERROR"
  339. MatchStr "17" "LOG IN:"
  340. DsplyMsg "Step 5: Talking to network (part 1)"
  341. Xmit "~TYM1\0D"
  342. Wait 3600
  343. IncTries
  344. IfTries 4 37
  345. Jump "17"
  346. !
  347. -Label 18
  348. ClrMchStr
  349. MatchStr "15" "+"
  350. MatchStr "17" "LOG IN:"
  351. MatchStr "32" "ERROR"
  352. MatchStr "18" "PASSWORD:"
  353. MatchStr "44" "NO CARRIER"     
  354. DsplyMsg "Step 5: Talking to network (part 2)"
  355. Xmit "~TYM2\0D"
  356. Wait 3600
  357. IncTries
  358. IfTries 4 37
  359. Jump "18"
  360. !
  361. !
  362. -Label 23
  363. DsplyMsg "Step 7:  Checking Password…"
  364. Exit 0
  365. !
  366. !----------------------------------------------------------------------
  367. !
  368. -Label 24               {User aborted connect sequence}
  369. Exit -51
  370. !
  371. -Label 25                {User aborted but we dont need to hang up.
  372. Exit -111
  373. !----------------------------------------------------------------------
  374. !
  375. -Label 26              {Busy phone}
  376.  
  377. IfEq ~ATMP 0
  378. DsplyMsg "The number dialed is busy. Trying second number."
  379. Talert "The number dialed is busy.  Please try again later.\0D\0DTo find another local access number, select Get Local # from the Locality pop-up menu, and click on Sign On."
  380. IfEq ~ATMP 1
  381. OneAlert 1 "\0D\0DFor more information, select Help from the Apple menu."
  382. Exit -1
  383. !
  384. !----------------------------------------------------------------------
  385. !
  386. -Label 27              {No Answer}
  387.  
  388. IfEq ~ATMP 0
  389. DsplyMsg "The number dialed is not answering. Trying second number."
  390. TAlert "The number dialed is not answering.  Please try again later.\0D\0DTo find another local access number, select Get Local # from the Locality pop-up menu, and click on Sign On."
  391. IfEq ~ATMP 1
  392. OneAlert 1 "\0D\0DFor more information, select Help from the Apple menu."
  393. Exit -1
  394. !
  395. !----------------------------------------------------------------------
  396. !
  397. -Label 28
  398.  
  399. Talert "The access company failed to respond.  Please try again later.\0D\0DTo find another local access number, select Get Local # from the Locality pop-up menu, and click on Sign On."
  400. IfEq ~ATMP 1
  401. OneAlert 1 "\0D\0DFor more information, select Help from the Apple menu."
  402. Exit -1
  403. !
  404. !----------------------------------------------------------------------
  405. !
  406. -Label 32              {not_avail}
  407.  
  408. TAlert "The final connection step to ~APPL did not complete.  Please try again later."
  409. Jump "36"
  410. !
  411. !----------------------------------------------------------------------
  412. !
  413. -Label 33              {no response from modem}
  414.  
  415. TAlert "~APPL was unable to initialize your modem.\0D\0D1. Turn your modem off, then back on.\0D2. Check your modem cable connections.\0D"
  416. IfEq ~ATMP 1
  417. OneAlert 1 "3  Click on Setup, and verify your modem type selection.\0D\0DFor more information, select Help from the Apple menu."
  418. Exit -1
  419. !
  420. !----------------------------------------------------------------------
  421. !
  422. -Label 34               {db_error}
  423. Talert "There is a bad ~APPL file on your disk (Error # 0).\0D\0D"
  424. Jump "36"
  425. !
  426. !----------------------------------------------------------------------
  427. !
  428. -Label 35
  429. Exit -1
  430. !
  431. !----------------------------------------------------------------------
  432. !
  433. -Label 36
  434. IfEq ~ATMP 1
  435. OneAlert 1 "\0D\0DFor more information, select Help from the Apple menu."
  436. Exit -1
  437. !
  438. !---------------------------------------------------------------------
  439. !Some new error codes since error 1 was getting meaningless.
  440. -Label 37          {time-out}
  441. TAlert "It has taken too long to process your connection.\0D\0D1. Test your modem with another communications program.\0D2. Verify the local access number by selecting Get Local # "
  442. IfEq ~ATMP 1
  443. OneAlert 1 "from the Locality pop-up menu, then clicking on Sign On.\0D\0DFor more information, select Help from the Apple menu."
  444. Exit -1
  445. !
  446. -Label 38          {modem command error}
  447. TAlert "Your modem is not accepting our commands.\0D\0D1. Turn your modem off, then back on.\0D2. Click on Setup, and verify your modem type selection."
  448. Jump "36"
  449. !
  450. -Label 40
  451.  
  452. TAlert "The modem has reported no dial tone.\0D1. Check the phone line connections.\0D2. Make sure the line from the wall is connected to the jack labeled Line, Telco, Wall, or Jack.\0D"
  453. IfEq ~ATMP 1
  454. OneAlert 1 "3. Use a telephone to check for a dial tone.\0D\0DFor more information, select Help from the Apple menu."
  455. Exit -1
  456. !
  457. -Label 41
  458.  
  459. TAlert "The number dialed did not connect to the access company.\0D\0D1. Verify your setup information by clicking on Setup.\0D2. Verify the local access number by selecting Get Local # "
  460. IfEq ~ATMP 1
  461. OneAlert 1 "from the Locality pop-up menu, then clicking on Sign On.\0D\0DFor more information, select Help from the Apple menu."
  462. Exit -1
  463. !
  464. -Label 42
  465.  
  466. TAlert "The modem was unable to get a carrier signal.\0D\0D1. Verify your setup information by clicking on Setup.\0D2. Verify the local access number by selecting Get Local # "
  467. IfEq ~ATMP 1
  468. OneAlert 1 "from the Locality pop-up menu, then clicking on Sign On.\0D\0DFor more information, select Help from the Apple menu."
  469. Exit -1
  470. !
  471. -Label 43
  472.  
  473. TAlert "The modem detected a timeout.\0D\0D1. Test your modem with another communications program.\0D2. Verify the local access number by selecting Get Local # "
  474. IfEq ~ATMP 1
  475. OneAlert 1 "from the Locality pop-up menu, then clicking on Sign On.\0D\0DFor more information, select Help from the Apple menu."
  476. Exit -1
  477. !
  478. -Label 44
  479.  
  480. OneAlert 1 "The modem has lost carrier signal.\0D\0DPlease try signing on again. "
  481.  
  482. Exit -1
  483. !------------------------------------
  484. -Label CheckPhoneLength
  485. !
  486. NewString sPhoneNumber
  487. SetVar sPhoneNumber ~FONE
  488. NewLngInt lCount
  489. SetVar lCount 6
  490. !
  491. -Label TopPhoneLoop
  492. IfEq lCount 0
  493. Jump "FinishPhoneLength"
  494. DecVar sPhoneNumber
  495. DecVar lCount
  496. Jump "TopPhoneLoop"
  497. !
  498. -Label FinishPhoneLength
  499. IfEq sPhoneNumber ""
  500. Jump "EmptyPhone"
  501. Return
  502. !
  503. -Label EmptyPhone
  504. OneAlert 1 "You must enter phone numbers before signing on.\0D\0DSelect ""Setup"" and verify the phone numbers you have entered."
  505. Exit -111
  506. !------------------------------------
  507. !
  508. *-Label 0                {Hangup Sequence}
  509. *CanBtn "2"
  510. !
  511. *Flush
  512. !
  513. *ClrMchStr
  514. *MatchStr "1" "OK"         { Dont look for an echo, may be a}
  515. *MatchStr "1" "NO"         { false echo.  Any type of match is good}
  516. *MatchStr "1" ">"          { Special case for Avatex 1200 modems}
  517. !
  518. *Pause 180               { Pause for 3 sec min gap }
  519. *Xmit "+++"              { Get the modems attention}
  520. *Pause 180               { Pause for 3 sec min gap }
  521. !
  522. *ClrMchStr
  523. *MatchStr "1" "OK"
  524. *MatchStr "2" "CARRIER"    {Any type of match is good}
  525. *MatchStr "1" ">"          { Special case for Avatex 1200 modems}
  526. !
  527. *Pause 180               { Pause for 3 sec min gap }
  528. *Xmit "+++"              { Get the modems attention}
  529. *Pause 180               { Pause for 3 sec min gap }
  530. !
  531. *-Label 1
  532. *ClrMchStr
  533. *MatchStr "2" "ERROR"
  534. *MatchStr "2" "OK"
  535. *MatchStr "2" "CARRIER"
  536. *MatchStr "2" ">"         { Special case for Avatex 1200 modems}
  537. !
  538. *Pause 40
  539. *Xmit "$ATTENTION$H\0D"
  540. *Wait 300
  541. !
  542. *-Label 2
  543. *Pause 40                { Allow modem to settle between commands.}
  544. *ZMIT "3" "$ATTENTION$$REST$\0D"         { Send shutdown string}
  545. !
  546. *-Label 3
  547. *Exit 0
  548. ###
  549.